<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>OCILIB (C and C++ Driver for Oracle): Overview</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">OCILIB (C and C++ Driver for Oracle)
   &#160;<span id="projectnumber">4.2.1</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>About</span></a></li>
      <li><a href="modules.html"><span>Documentation</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group___ocilib_cpp_api_overview.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">Overview<div class="ingroups"><a class="el" href="group___ocilib_cpp_api.html">C++ API</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<dl class="section user"><dt>Introduction</dt><dd>OCILIB++ is a C++ API for Oracle built on top of the C OCILIB API:<ul>
<li>Full C API ported to C++</li>
<li>Implemented as a small set of header files, no library compilation needed</li>
<li>Based on C++ and STL paradigms (Strong typing, templates, containers, RAII, exception handling, operators, stack objects)</li>
<li>Based on design patterns (RAII, delegation, reference counting, smart pointers, proxies, singleton)</li>
<li>No user dynamic object allocation required</li>
<li>The only dependences are : STL and OCILIB C API</li>
</ul>
</dd></dl>
<dl class="section user"><dt>C++ language requirements</dt><dd><ul>
<li>The OCILIB C++ API requires only C++03 features.</li>
<li>There are no dependencies on recent C++11 norm or C++14 draft.</li>
</ul>
</dd></dl>
<dl class="section user"><dt>Reference counting model</dt><dd><ul>
<li>API usage is very simple, based on stack objects wrapping OCILIB handles using reference counting.</li>
<li>OCILIB handles are automatically allocated internally by C++ objects constructors or methods.</li>
<li>They are also automatically freed when the last C++ object referencing it goes out of scope.</li>
<li>Dynamic memory allocation is not required at all.</li>
<li>OCILIB++ allows simple and safe usage of Oracle client without the worries of memory leakages.</li>
<li>Using stack objects also makes error handling easier and program logic more robust</li>
</ul>
</dd></dl>
<dl class="section user"><dt>C++ API classes usage</dt><dd>Most C++ API classes wrap C API handles. When instances are created using the default constructors, they hold no C handles and have their method IsNull() returning true. Any use of other methods and functions on such object methods will throw an C++ exception. Thus, in order to have a valid object :<ul>
<li>use a parametrized constructor</li>
<li>use the default constructor and then later assign a value to the instance using assignment operator. In the later case, the value can be provided by a function return value or using the object class constructor</li>
</ul>
</dd></dl>
<dl class="section user"><dt>Exception model</dt><dd><ul>
<li>Any failure occurring within an OCILIB C API call will throw a <a class="el" href="classocilib_1_1_exception.html" title="Exception class handling all OCILIB errors. ">ocilib::Exception</a></li>
<li>For conformance reasons, this class derives from std::Exception</li>
</ul>
</dd></dl>
<dl class="section warning"><dt>Warning</dt><dd><ul>
<li>OCILIB++ wraps the whole OCILIB C API.</li>
<li>Each C OCILIB object handle has its C++ class counter part.</li>
<li>The whole OCILIB C Documentation (concepts, use cases, features and functionalities) is still valid for OCILIB++ </li>
</ul>
</dd></dl>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated on Mon Mar 21 2016 22:26:38 for OCILIB (C and C++ Driver for Oracle) by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.9.1 </li>
  </ul>
</div>
</body>
</html>
